<template>
  <div>
    <!-- 头 -->
    <my-header v-if="!$route.meta.hideHeader"></my-header>
    <!-- 身体 -->
    <router-view :key="$route.fullPath"></router-view>
    <!-- 脚 -->
    <my-footer v-if="!$route.meta.hideFooter"></my-footer>

    <!-- <WnFooterMusic> </WnFooterMusic> -->
  </div>
</template>

<script>
import myHeader from "./components/myHeader.vue";
import "../src/assets/css/icon.css";
import "../src/assets/css/reset.css";
import "../src/assets/css/utils.css";
import MyFooter from "./components/myFooter.vue";
import WnFooterMusic from "./components/WnFooterMusic.vue";
import { mapMutations, mapState } from "vuex";

export default {
  components: { myHeader, MyFooter, WnFooterMusic},
  computed: {
    ...mapState(["userInfo"]),
  },
  methods: {
    ...mapMutations(["updateUserInfo"]),

    checkUserStatus() {
      console.log("checkUserStatus: ");
      console.log(this.userInfo);
      if (this.userInfo == null) {
        console.log("当前无用户登录");
        return;
      }
      // 等完全做好后再打开

      // var url = "login/refresh"
      // this.axios.get(url).then(res => {
      //   if(res.data.code != 200) {
      //       this.updateUserInfo(null);
      //   }
      // })
    },
  },
  mounted() {
    this.checkUserStatus();
  },
};
</script>

<style lang="scss" scoped>
</style>
